#ifndef SCT_DECODE_VIDEODEC_H
#define SCT_DECODE_VIDEODEC_H

extern "C"
{
#include <libavutil/opt.h>
#include <libavcodec/avcodec.h>
#include <libavutil/common.h>
#include <libavutil/mathematics.h>
#include <libavutil/avutil.h>
#include <libswscale/swscale.h>
#include <libavformat/avformat.h>
#include <libswresample/swresample.h>
}

#include "sct/core/common.h"
#include "sct/decode/decodeinterface.h"

namespace sct
{
class CVideoDec: public CDecodeInterface
{
public:
	CVideoDec(const CodecType codecType);
	virtual ~CVideoDec();

	virtual void init();
    virtual void decode(const void * d, const int len, const int64_t pts);
private:
	AVCodec *mCodec;
	AVCodecContext* mCodecCtx;
	struct SwsContext *mSwsCtx;

	AVPacket mPkt;
	AVFrame * mFrame;

	uint8_t * mImage;
	int mSize;
};
}

#endif
